home *** CD-ROM | disk | FTP | other *** search
- package sub_arctic.lib;
-
- /**
- * This class is a convenient way to put arbitrary objects into a listbox and
- * have them displayed as strings. However, when you ask for the objects in
- * the selected set or the contents of the listbox, you'll get the
- * original objects back. <P>
- *
- * The object you supply is converted to a string by using toString().
- *
- * @author Ian Smith
- */
- public class object_list_element extends text_list_element {
-
- /* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . */
-
- /**
- * This is the object we are displayed.
- */
- protected Object _obj;
-
- /**
- * Retrieve the object we are displaying.
- */
- public Object obj() { return _obj;}
-
- /* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . */
-
- /**
- * Create a new object_list_element given an object. This object
- * will be displayed in the listbox using its string name (toString().
- * @param Object o the object to put in the listbox
- */
- public object_list_element(Object o) {
- super(o.toString());
- _obj=o;
- }
-
- /* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . */
-
- /**
- * Return the object you originally supplied when asked for it
- * by the listbox.
- * @return Object the object supplied at construction time
- */
- public Object convert_to_object() { return _obj;}
-
- /* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . */
- }
- /*=========================== COPYRIGHT NOTICE ===========================
-
- This file is part of the subArctic user interface toolkit.
-
- Copyright (c) 1996 Scott Hudson and Ian Smith
- All rights reserved.
-
- The subArctic system is freely available for most uses under the terms
- and conditions described in
- http://www.cc.gatech.edu/gvu/ui/sub_arctic/sub_arctic/doc/usage.html
- and appearing in full in the lib/interactor.java source file.
-
- The current release and additional information about this software can be
- found starting at: http://www.cc.gatech.edu/gvu/ui/sub_arctic/
-
- ========================================================================*/
-